import sqlite3

# 创建数据库连接
conn = sqlite3.connect('text.db')
cursor = conn.cursor()
# 创建一个表
# cursor.execute('create table user (id varchar(20) primary key, name varchar(20))')
# 插入一条数据
cursor.execute('insert into user (id, name) values (\'2\', \'Michael\')')
cursor.execute('select * from user where id = ?',('1',))
var = cursor.fetchall()
print(cursor.rowcount)
print(var)
cursor.close()
conn.commit()
conn.close()